const order = {
  namespaced: true,
  // 因为所有模块的方法都注册在全局模块中，所以需要创建一个命名空间，使得本模块的方法注册在本模块中
  state: {
    // 订单页中包括所有订单以及现在要购买的订单
    orders: [],
    nowOrder: {
      // 订单号独一无二，这里使用时间戳，工作中后台提供
      // new Date().getTime()
      code: '1599879045365',
      items: [
        /*
        afterSale: "0,1,2"
        categoryId: 164510
        characteristic: "粉/蓝双色人造纸7张，粉色缎带1米"
        commission: 0
        commissionType: 0
        dateAdd: "2020-09-09 20:33:16"
        dateUpdate: "2020-09-12 16:24:40"
        fxType: 2
        gotScore: 0
        gotScoreType: 0
        hidden: 0
        id: 565048
        isChecked: true
        kanjia: false
        kanjiaPrice: 0
        limitation: false
        logisticsId: 0
        maxCoupons: 1
        miaosha: false
        minBuyNumber: 1
        minPrice: 199
        minScore: 0
        name: "钟意你"
        num: 1
        numberFav: 0
        numberGoodReputation: 0
        numberOrders: 0
        numberSells: 0
        originalPrice: 259
        overseas: false
        paixu: 0
        pic: "https://dcdn.it120.cc/2020/09/09/bdc5d13e-fd0b-4dbb-8ca6-c79bbc12cecc.jpg"
        pingtuan: false
        pingtuanPrice: 0
        purchaseNotes: "因季节原因和各地花艺师包扎手法不同，实物的辅材和细节可能与图片不完全一致，我们保证主花材与说明一致，谢谢您的理解！"
        recommendStatus: 0
        recommendStatusStr: "普通"
        sellEnd: false
        sellStart: true
        shopId: 0
        status: 0
        statusStr: "上架"
        storeAlert: false
        storeAlertNum: 1
        stores: 7
        stores0Unsale: false
        tags: "戴安娜玫瑰11枝,粉色太阳花9枝,大叶尤加利6枝"
        type: 0
        unit: "份"
        userId: 29026
        vetStatus: 1
        views: 17
        weight: 0.5
        */
      ], // 添加的商品
      address: {}, // 地址联系人 内容由地址列表决定
      nonPayment: 0 // 待支付金额
    }
  },
  mutations: {
    setOrder (state, order) {
      state.nowOrder = order
    },
    // 切换当前订单的地址联系人
    changeNowOrderAddress (state, changedAddress) {
      state.nowOrder.address = changedAddress
    }
  },
  actions: {
  }

}

export default order
